*****************************************************
***** Table A5: PRODUCTIVITY ADDITIONAL OUTCOMES  		
*****************************************************



use "$dir/Data/analysis_main.dta", clear


eststo clear
eststo: reghdfe present_day cash_postpay cash_announce blhrprod blhrprodsq blhrprod_miss bs_labor_30_miss future_fin_worry_miss i.pd if pd>0 & pidday1==1, vce(cl pid) absorb(roundgroup)
	qui estadd scalar N2 = e(N)
	qui summ present_day if e(sample)==1 & pd==2 & cash==0 & pidday1==1
	qui estadd scalar avg = r(mean)	
	
eststo: reghdfe workingtime cash_postpay cash_announce blhrprod blhrprodsq blhrprod_miss bs_labor_30_miss future_fin_worry_miss i.pd if pd>0 & pidday1==1, vce(cl pid) absorb(roundgroup)
	qui estadd scalar N2 = e(N)
	qui summ workingtime if e(sample)==1 & pd==2 & cash==0 & pidday1==1
	qui estadd scalar avg = r(mean)		
	
eststo: reghdfe output_rej_sh cash_postpay cash_announce blhrprod blhrprodsq blhrprod_miss bs_labor_30_miss future_fin_worry_miss i.pd if pd>0 , vce(cl pid) absorb(roundgroup)
	qui estadd scalar N1 = e(N)
	qui summ output_rej_sh if e(sample)==1 & pd==2 & cash==0
	qui estadd scalar avg = r(mean)
	
eststo: reghdfe n_productivity_tot cash_postpay cash_announce blhrprod blhrprodsq blhrprod_miss bs_labor_30_miss future_fin_worry_miss i.pd if pd>0 , vce(cl pid) absorb(roundgroup) 
	qui estadd scalar N1 = e(N)
	summ n_productivity_tot if e(sample)==1 & pd==2 & cash==0
	estadd scalar avg `r(mean)'
	qui estadd local rej "Y"


	
#delimit ;
local tablerow cash_postpay;
esttab using "$oa/$t/Table_A5.tex", 
    b(3) se booktabs star(* .1 ** .05 *** .01) nonotes nomtitles  
    replace label style(tex) gaps keep(`tablerow') order(`tablerow') 
    stats(avg rej N2 N1, labels("Control group mean" "Include rejections" "N: worker-days" "N: worker-hours" ) fmt(%9.3fc %20s %9.0fc %9.0fc)) 
	prehead("{\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi} \begin{tabular}
    {@{\extracolsep{4pt}}l*{4}{>{\centering\arraybackslash}m{2.6cm}}@{}} 
    \toprule  
	& Attendance & Number of hours worked in a day & Share of rejections & Total hourly production  \\ 
	") ;
#delimit cr	


